/*

Rules to layout controls.

Important:
    - Don't provide colors here. The colors are provided by the dark.css and light.css files.

*/

* {
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.UserSelectText * {
    user-select: text !important;
    -webkit-touch-callout: text !important;
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

body {
    overflow-y: hidden;
}

input {
    -webkit-user-select: text !important;
    -khtml-user-select: text !important;
    -moz-user-select: text !important;
    -o-user-select: text !important;
    user-select: text !important;
    box-sizing: border-box;
}

button {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    height: 2em;
    min-height: 2em;
}

button:active,
button:focus {
    outline-width: 1px;
    outline-color: rgba(255, 255, 255, 0.1);
}

canvas {
    outline: none;
    image-rendering: crisp-edges;
}

.Control {
    position: absolute;
    box-sizing: border-box;
}

.ImageControl {
    position: fixed;
}

/* Tooltip */

.Tooltip {
    position: fixed;
    border-width: 1px;
    border-style: solid;
    padding: 5px;
}

.TooltipKeyString {
    font-family: monospace;
}

/* TabPane */

.TabPane {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

.TabPaneTitleBar {
    display: flex;
    overflow-x: auto;
}

div.TabPaneTitleBar::-webkit-scrollbar {
    height: 7px;
}

.TabPaneLabel {
    float: left;
    display: grid;
    grid-template-columns: min-content 1fr min-content;
    align-items: center;
    border-radius: 2px 2px 0 0;
    padding: 5px 10px 5px 5px;
}

.TabPaneLabel span {
    margin-left: 5px;
}

.TabPaneContentArea {
    border-radius: 0 3px 3px 3px;
}

.TabPaneContentArea .ContentArea {
    display: none;
}

.TabPaneContentArea .ContentArea.selected {
    display: block;
}

.TabPaneContentArea,
.TabPaneContentArea .ContentArea {
    position: relative;
    width: 100%;
    height: 100%;
}


/* ScrollPane */

::-webkit-scrollbar {
    width: 15px;
}

.ScrollBar,
.ScrollHandler {
    position: relative;
}

.ScrollHandler,
::-webkit-scrollbar-thumb {
    border-radius: 3px;
}

.ScrollPane.hideScrollBar {
    grid-template-columns: 1fr 0px !important;
}

.ScrollPane.hideScrollBar .ScrollBar {
    display: none;
}

/* Zoom */

.ZoomControl {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px;
    border-radius: 3px;
    background: black;
    display: grid;
    grid-template-columns: auto auto auto;
    column-gap: 2px;
    opacity: 0.1;
    z-index: 3;
}

.ZoomControl:hover {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.5);
}

/* Viewer */

.FilteredViewer {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

.FilterControl {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: center;
    box-sizing: border-box;
    padding: 5px 6px 5px 6px;
}

.FilterControl input {
    width: 100%;
}

.FilteredViewer>.ScrollPane {
    position: static;
    display: grid;
    grid-template-columns: 1fr 15px;
    grid-template-rows: 1fr;
}

.FilteredViewer .FilterControl {
    position: relative;
    width: 100%;
}

.FilteredViewer .ViewerContainer {
    position: static;
}

.ViewerContainer .Viewer {
    position: fixed;
}

/* PropertyPage */

.PropertyPage {
    display: grid;
    grid-template-columns: 100%;
    align-items: start;
    position: relative;
    padding: 5px;
    width: 100%;
    height: 100%;
    row-gap: 5px;
    overflow-y: auto;
}

.PropertySectionPane {
    display: grid;
    grid-template-rows: auto 1fr;
    position: initial;
    height: 100%;
    margin: 0px;
    border-radius: 3px;
}

.PropertyTitleArea {
    display: inline-grid;
    grid-template-columns: 20px 1fr auto;
    padding: 5px;    
    border-radius: 3px;
}

.PropertyTitleArea label {
    overflow: hidden;
    white-space: nowrap;
    word-break: break-all;
    text-overflow: ellipsis;    
}

.PropertyFormArea {
    display: grid;
    padding: 10px 0px 10px 0px;
}

.PropertyButtonPanel {
    width: 100%;
    display: block;
}

.PropertyButtonPanel button {
    float: right;
    margin-left: 5px;
    font-size: small;
}

.PropertySubTitlePanel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-column: 1 / span 2;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    padding: 3px;
    border-radius: 3px;
}

.PropertySubTitleLabel {
    width: 100%;    
}

.formSimpleProps {
    padding: 5px;
}

.formLabel {
    justify-self: self-end;
}

/* Toolbar */

.IconButton {
    border-radius: 3px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0);
    border-width: 1px;
}

.IconButton:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 0, 0, 0.2);
}

.ToolbarItem {
    display: flex;
    float: left;
    margin-right: 5px;
    padding: 5px;
    border-radius: 3px;
    border-style: solid;
    border-width: 1px;
}

.ToolbarItemHasTextAndIcon canvas {
    margin-right: 3px;
}

.ToolbarItemHideText .ToolbarItemText {
    display: none;
}

/* ProgressBar */

.ProgressBar {
    height: 10px;
}

/* Dialog */

.DialogContainer {
    position: absolute;
    z-index: 1000;
    left: 0px;
    right: 0px;
    width: 100%;
    height: 100%;
}

.Dialog {
    position: absolute;
    z-index: 1001;
    border-radius: 5px;
    border-width: 1px;
    border-color: rgba(0, 0, 0, 0.5);
    box-shadow:
        -12px -5px 22px rgba(0, 0, 0, 0.2),
        12px 12px 22px rgba(0, 0, 0, 0.2),
        -12px 12px 22px rgba(0, 0, 0, 0.2),
        12px -5px 22px rgba(0, 0, 0, 0.2);

}

.Dialog {
    display: grid;
    grid-template-columns: 5px 1fr 5px;
    grid-template-rows: 5px auto 5px 1fr 5px auto 5px;
}

.DialogHalfScreenHeight {
    height: 50%;
}

.Dialog .DialogTitlePane {
    width: 100%;
    grid-column-start: 2;
    grid-row-start: 2;
    font-size: small;
    text-align: center;
}

.Dialog .DialogClientArea {
    position: relative;
    width: 100%;
    height: 100%;
    grid-column-start: 2;
    grid-row-start: 4;
    box-sizing: content-box;
}

.Dialog .FilteredViewer,
.Dialog .DialogSection {
    border-radius: 3px;
}

.Dialog .DialogSection {
    padding: 5px;
    box-sizing: border-box;
}

.Dialog .DialogButtonPane {
    grid-row-start: 6;
    grid-column-start: 2;
    display: block;
}

.Dialog .DialogButtonPane button {
    float: right;
    margin-left: 10px;
}

/* AlertDialog */

.AlertDialog {
    height: auto !important;
}

.AlertDialog .DialogClientArea {
    padding: 10px;
}

.AlertDialog .DialogClientArea pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 5px 0px;
}

/* InputDialog */

.InputDialog {
    height: auto !important;
}

.InputDialogLabel {
    padding: 1em 0px;
}

/* ProgressDialog */

.ProgressDialog {
    height: auto !important;
}

.ProgressDialog .ProgressBar {
    border-radius: 3px;
}

/* Upload Dialog */

.FilesDragEnter {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Menu */

.Menu {
    position: fixed;
}

.MenuItem {
    display: grid;
    grid-template-columns: 30px 20px 1fr auto;
    padding: 5px 10px 5px 0px;
}

.MenuNoIcon .MenuItem {
    grid-template-columns: 30px 0px 1fr auto;
}

.MenuItemCheckedIcon {
    grid-column-start: 1;
    justify-self: center;
}

.MenuItemIcon {
    grid-column-start: 2;
    justify-self: center;
    margin-right: 5px;
}

.MenuItemText {
    grid-column-start: 3;
}

.MenuItemKeyString {
    font-family: monospace;
    margin-left: 3em;
    grid-column-start: 4;
}

.MenuContainer {
    position: absolute;
    left: 0px;
    right: 0px;
    width: 100%;
    height: 100%;
}

.MenuItemSeparator {
    height: 1px;
}